<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css" />
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css" />
	</head>

	<body>
		<div class="am-g">
			{include file='../Common/hy_header.html'}
			<form class="am-form am-form-horizontal hy-js-form">
			<div class="am-u-md-8 am-u-end">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label"> 记者头像</label>
						<div class="am-u-sm-6">
							<input type="text" name="reporter_url" class="am-input-sm" value="{$info.reporter_url}">
						</div>
						<div class="am-u-sm-3">
							 <img style="height: 30px;" id="reporter_url"  {if $info.reporter_url} src="/ws/{$info.reporter_url}" {else} src="{$_C.hy_path}images/logo2.png" {/if}>
			             		<button class="am-btn am-btn-primary am-btn-xs hy-js-attrimg" hy-id="reporter_url" >上传</button>
						</div>
					</div>
					<div class="am-form-group">
						<span style="color:red">头像比例：72*72(高＊宽)</span>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">记者名：</label>
						<div class="am-u-sm-9">
							<input type="text" name="reporter_name" value="{$info.reporter_name}" placeholder="记者名">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">首页标题：</label>
						<div class="am-u-sm-9">
							<input type="text" name="title" value="{$info.title}" placeholder="首页标题">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">首页描述</label>
						<div class="am-u-sm-9">
							<textarea name="home_desc" value="{$info.home_desc}"  rows="3" class="w200">{$info.home_desc}</textarea>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label"> 首页新闻缩略图</label>
						<div class="am-u-sm-6">
							<input type="text" name="thumb_url" class="am-input-sm" value="{$info.thumb_url}">
						</div>
						<div class="am-u-sm-3">
							 <img style="height: 30px;" id="thumb_url"  {if $info.thumb_url} src="/ws/{$info.thumb_url}" {else} src="{$_C.hy_path}images/logo2.png" {/if}>
			             		<button class="am-btn am-btn-primary am-btn-xs hy-js-attrimg" hy-id="thumb_url" >上传</button>
						</div>
					</div>
					<div class="am-form-group">
						<span style="color:red">缩略图比例：120*100(宽＊高)</span>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label"> 记者打赏二维码</label>
						<div class="am-u-sm-6">
							<input type="text" name="gratuity_url" class="am-input-sm" value="{$info.gratuity_url}">
							
				            	
						</div>
						<div class="am-u-sm-3">
							 <img style="height: 30px;" id="gratuity_url"  {if $info.gratuity_url} src="/ws/{$info.gratuity_url}" {else} src="{$_C.hy_path}images/logo2.png" {/if}>
			             		<button class="am-btn am-btn-primary am-btn-xs hy-js-attrimg" hy-id="gratuity_url" >上传</button>
						</div>
						
					</div>
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" name="id" value="{$info.id}" />
							<button type="button" class="am-btn am-btn-primary hy-js-submit">{$_L.SAVE}</button>
						</div>
					</div>
			</div>
			</form>
		</div>
		{include file='../Common/hy_footer.html'}
		<script type="text/javascript">
		hy_uploadimg('/reporter', {
			target: '.hy-js-attrimg'
		}, function(result, _this) {
			if (typeof(result[0]) != 'undefined') {
				var name = _this.attr('hy-id');
				$("#"+name).attr('src',"/ws"+result[0]);
				$("input[name='"+name+"']").val(result[0]);
			}
		});
		   hy_submit('index.php?g=admin&m=reporter&a=updateReporter','',function(result){
				if(result.error==1)
				{
					showMsg(result.content,result.error);
				}
				else
				{
					parent.$('#myReporterInfo').attr('src', parent.$('#myReporterInfo').attr('src'));
					var tab_li = parent.$(".am-active");
					if(tab_li.prev().length>0)
					{
						tab_li.prev().addClass('am-active');
						var id=tab_li.prev().attr('data-id');
				        parent.$('#'+id).show();
					}
					else if(tab_li.next().length>0)
					{
						tab_li.next().addClass('am-active');
						var id=tab_li.next().attr('data-id');
				        parent.$('#'+id).show();
					}
					else
					{
						var tab='<li data-id="index" class="am-active"><a  href="javascript:;"><span class="hy-tabs-title">首页</span><span class="am-icon-close"></span></a></li>'
					    parent.$('.hy-tabs .am-nav').append(tab);
					    var iframe='<iframe onload="javascript:hy_loading()" id="index" src="index.php?g=admin&m=index&a=main" width="100%" height="100%"></iframe>';
					    parent.$('.hy-iframe').append(iframe);
					}
					var id=tab_li.attr('data-id');
					tab_li.remove();
					parent.$("#"+id).remove();
				}
			});
		</script>
	</body>

</html>